Set the background on the action view cell renderer here, not in init, so
authorMatthias Clasen <maclas@gmx.de>
Wed, 10 Mar 2004 22:42:48 +0000 (22:42 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Wed, 10 Mar 2004 22:42:48 +0000 (22:42 +0000)
Wed Mar 10 23:40:15 2004  Matthias Clasen  <maclas@gmx.de>

* gtk/gtkentrycompletion.c (_gtk_entry_completion_popup): Set the background
on the action view cell renderer here, not in init, so that a) we catch
style changes, and b) we get the real style, not the default one.
Partial fix for #127648, reported by Dave Bordoley.

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtkentrycompletion.c

index 819ee3fcd8ee2f5be3e9881601c1e52d3bcad2e6..0ba1be5fc0f079dbad4ecd4715c0a562323ce322 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+Wed Mar 10 23:40:15 2004  Matthias Clasen  <maclas@gmx.de>
+
+       * gtk/gtkentrycompletion.c (_gtk_entry_completion_popup): Set the background
+       on the action view cell renderer here, not in init, so that a) we catch 
+       style changes, and b) we get the real style, not the default one. 
+       Partial fix for #127648, reported by Dave Bordoley.
+
 2004-03-10  Tor Lillqvist  <tml@iki.fi>
 
        * gdk/win32/gdkevents-win32.c (build_key_event_state): Set also
index 819ee3fcd8ee2f5be3e9881601c1e52d3bcad2e6..0ba1be5fc0f079dbad4ecd4715c0a562323ce322 100644 (file)
@@ -1,3 +1,10 @@
+Wed Mar 10 23:40:15 2004  Matthias Clasen  <maclas@gmx.de>
+
+       * gtk/gtkentrycompletion.c (_gtk_entry_completion_popup): Set the background
+       on the action view cell renderer here, not in init, so that a) we catch 
+       style changes, and b) we get the real style, not the default one. 
+       Partial fix for #127648, reported by Dave Bordoley.
+
 2004-03-10  Tor Lillqvist  <tml@iki.fi>
 
        * gdk/win32/gdkevents-win32.c (build_key_event_state): Set also
index 819ee3fcd8ee2f5be3e9881601c1e52d3bcad2e6..0ba1be5fc0f079dbad4ecd4715c0a562323ce322 100644 (file)
@@ -1,3 +1,10 @@
+Wed Mar 10 23:40:15 2004  Matthias Clasen  <maclas@gmx.de>
+
+       * gtk/gtkentrycompletion.c (_gtk_entry_completion_popup): Set the background
+       on the action view cell renderer here, not in init, so that a) we catch 
+       style changes, and b) we get the real style, not the default one. 
+       Partial fix for #127648, reported by Dave Bordoley.
+
 2004-03-10  Tor Lillqvist  <tml@iki.fi>
 
        * gdk/win32/gdkevents-win32.c (build_key_event_state): Set also
index 819ee3fcd8ee2f5be3e9881601c1e52d3bcad2e6..0ba1be5fc0f079dbad4ecd4715c0a562323ce322 100644 (file)
@@ -1,3 +1,10 @@
+Wed Mar 10 23:40:15 2004  Matthias Clasen  <maclas@gmx.de>
+
+       * gtk/gtkentrycompletion.c (_gtk_entry_completion_popup): Set the background
+       on the action view cell renderer here, not in init, so that a) we catch 
+       style changes, and b) we get the real style, not the default one. 
+       Partial fix for #127648, reported by Dave Bordoley.
+
 2004-03-10  Tor Lillqvist  <tml@iki.fi>
 
        * gdk/win32/gdkevents-win32.c (build_key_event_state): Set also
index 819ee3fcd8ee2f5be3e9881601c1e52d3bcad2e6..0ba1be5fc0f079dbad4ecd4715c0a562323ce322 100644 (file)
@@ -1,3 +1,10 @@
+Wed Mar 10 23:40:15 2004  Matthias Clasen  <maclas@gmx.de>
+
+       * gtk/gtkentrycompletion.c (_gtk_entry_completion_popup): Set the background
+       on the action view cell renderer here, not in init, so that a) we catch 
+       style changes, and b) we get the real style, not the default one. 
+       Partial fix for #127648, reported by Dave Bordoley.
+
 2004-03-10  Tor Lillqvist  <tml@iki.fi>
 
        * gdk/win32/gdkevents-win32.c (build_key_event_state): Set also
index 1a5b754633bd4cc933cc35d24f4b27915a8d1280..a68f21a1b9bc99a91defd96da2bfd7c5ca6e4564 100644 (file)
@@ -284,9 +284,6 @@ gtk_entry_completion_init (GtkEntryCompletion *completion)
   gtk_tree_selection_unselect_all (sel);
 
   cell = gtk_cell_renderer_text_new ();
-  g_object_set (cell, "cell_background_gdk",
-                &priv->tree_view->style->bg[GTK_STATE_NORMAL],
-                NULL);
   gtk_tree_view_insert_column_with_data_func (GTK_TREE_VIEW (priv->action_view),
                                               0, "",
                                               cell,
@@ -1119,10 +1116,20 @@ _gtk_entry_completion_popup (GtkEntryCompletion *completion)
   gint monitor_num;
   GdkRectangle monitor;
   GtkRequisition popup_req;
+  GtkTreeViewColumn *column;
+  GList *renderers;
 
   if (GTK_WIDGET_MAPPED (completion->priv->popup_window))
     return;
 
+  column = gtk_tree_view_get_column (GTK_TREE_VIEW (completion->priv->action_view), 0);
+  renderers = gtk_tree_view_column_get_cell_renderers (column);
+  gtk_widget_ensure_style (completion->priv->tree_view);
+  g_object_set (GTK_CELL_RENDERER (renderers->data), "cell_background_gdk",
+                &completion->priv->tree_view->style->bg[GTK_STATE_NORMAL],
+                NULL);
+  g_list_free (renderers);
+
   gtk_widget_show_all (completion->priv->vbox);
 
   gdk_window_get_origin (completion->priv->entry->window, &x, &y);